/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package cn.ekuma.epos.ical;

import java.awt.Color;
import java.util.Calendar;
import java.util.Date;
import us.k5n.ui.calendar.EventInstance;

/**
 *
 * @author Administrator
 */
public abstract class AbstractERPEvent implements EventInstance{
       protected String title, description, location;
       protected Calendar datetime;
       ERPCalendar cal;

      public AbstractERPEvent(){
          this(null,null,new Date());
      }
       
    public AbstractERPEvent(String title, String description,Date date) {
        this.title = title;
        this.description = description;
        datetime=Calendar.getInstance();
        datetime.setTime(date);
    }

       public String getTitle () {
		return title;
	}

	public String getDescription () {
		return description;
	}

	public String getLocation () {
		return null;
	}

	public boolean isAllDay () {
		return false;
	}

	public boolean hasTime () {
		return true;
	}

	public int getYear () {
		return datetime.get(Calendar.YEAR);
	}

	public int getMonth () {
		return datetime.get(Calendar.MONTH);
	}

	public int getDayOfMonth () {
		return datetime.get(Calendar.DAY_OF_MONTH);
	}

	public int getHour () {
		return datetime.get(Calendar.HOUR);
	}

	public int getMinute () {
		return datetime.get(Calendar.MINUTE);
	}

	public int getSecond () {
		return datetime.get(Calendar.SECOND);
	}

	public boolean hasDuration () {
		return false;
	}

	public int getDurationSeconds () {
		return 0;
	}

	public Color getForegroundColor () {
		return cal.getForegroundColor();
	}

	public Color getBackgroundColor () {
		return cal.getBackgroundColor();
	}

	public Color getBorderColor () {
		return cal.getBorderColor();
	}


	public void setDescription ( String description ) {
		this.description = description;
	}

	public void setTitle ( String title ) {
		this.title = title;
	}

    public ERPCalendar getERPCalendar() {
        return cal;
    }

    public void setERPCalendar(ERPCalendar cal) {
        this.cal = cal;
    }
}
